import java.util.Scanner;
public class Number {
    public static void main(String[] args)
    {
        Scanner input = new Scanner(System.in);
        int m = input.nextInt();
        int n = input.nextInt();
        int r = m*n;
        while(m!=n)
        {
            if(m>n)
            {
                m = m-n;
            }
            else
            {
                n = n-m;
            }
        }
        System.out.println(m+" "+r/m);
    }
}
